﻿using JetBrains.Annotations;

namespace MugenMvvmToolkit.Interfaces
{
    /// <summary>
    ///     Represents an interface that is responsible for notify the <c>IHandlersContainer</c>, when some state change.
    /// </summary>
    public interface IObservable
    {
        /// <summary>
        ///     Subscribes an instance to events.
        /// </summary>
        /// <param name="instance">The instance to subscribe for event publication.</param>
        bool Subscribe([NotNull]object instance);

        /// <summary>
        ///     Unsubscribes the instance from all events.
        /// </summary>
        /// <param name="instance">The instance to unsubscribe.</param>
        bool Unsubscribe([NotNull]object instance);
    }
}